<template>
  <el-dialog title="查看资质" v-model="visible" width="50%" :close-on-click-modal="false" :close-on-press-escape="false">
    <div v-for="info in qualiData.info" :key="info.customerQualificationId">
      <p>
        <span>营业执照:</span>
        <img :src="info.qualificationImg" alt="" style="width: 150px; height: 150px; vertical-align: top" />
      </p>
      <p>
        <span>{{ info.qualificationType }}</span>
      </p>
      <p>
        <span>{{ info.effectiveDate }} - {{ info.expiredDate }} </span>
      </p>
    </div>
  </el-dialog>
</template>

<script setup>
import { reactive, computed, watch } from 'vue'
import { ElMessage } from 'element-plus'
import api from '@/api'
import consts from '@/consts'

const emit = defineEmits(['update:visible', 'change'])
const props = defineProps(['visible', 'customerId'])

const visible = computed({
  get: () => {
    return props.visible
  },
  set: (value) => emit('update:visible', value)
})

watch(
  () => props.customerId,
  (val) => {
    if (val) {
      // qualiData.customerId = val
      // loadData()
    }
  }
)

const qualiData = reactive({
  info: [],
  customerId: ''
})

// const loadData = async () => {
//   let { data, err } = await api.get(`/medinstrument/boss/order/getCustomerQualification?customerId=${qualiData.customerId}`)
//   if (err) {
//     ElMessage.error(err)
//   } else {
//     qualiData.info = data.customerQualificationList
//   }
// }
</script>

